<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <select id="province" onchange="p()">
        <option value="0">--请选择省份--</option>
        <option value="1">河南</option>
        <option value="2">北京</option>
    </select>
    <select id="city">
        <option value="">--请选择诚实--</option>
    </select>
<script type="text/javascript">
    function p() {
       var a=  document.getElementById("province");
       var c=[["--请选择省份"],["郑州","洛阳"],["海淀","朝阳"]];
       var html;
       var b= a.value
       for (var a=0;a<c[b].length;a++){
            html+="<option>" + c[b][a]+"</option>"
           console.log(c[b][a])
       }
       document.getElementById("city").innerHTML=html;
    }
</script>
</body>
</html>